{% extends '::base.html.twig' %}

{% block title %}Technologies{% endblock %}

{% block topbar %}
<div id="topbar" style="background: url('/images/blue.png') repeat-x scroll 0 0 #B0B0B0">
    <strong class="wrapper">
        Technologies
    </strong>
</div>
{% endblock %}

{% block body %}
<div class="wrapper">
    <div id="content">
        {% for entity in entities %}
        <div class="entry blogentry">
            <h2><a href="">{{ entity | capitalize }}</a></h2>
            <div class="post-box">
            {% if entity.getWebPath() %}
                <img class="rounded" src="{{ entity.getWebPath() }}" alt='{{ entity }}' class="rounded" width='100%' height='270' />
            {% endif %}
            </div>
            <p>
                {{ entity.content | raw }}
                <span class="read-more">
                    <a href="{{ url('technology_show', {'id': entity.id}) }}">Read more »</a>
                </span>
            </p>
        </div>
        {% endfor %}

        <div class="big-spacer"></div>

        {% if lastPageNumber > 1 %}
        <div class="paginator">
            <div class="pagingContainer">
                {% if page > 1 %}
                    <a href="{{ path('technology_show') }}" class="first">First</a>
                    <a href="{{ path('technology_show', {'page' : page - 1}) }}">« Prev</a>
                {% endif %}
                <div>
                    {% for numberOfPage in 1..lastPageNumber %}
                        <a href="{{ path('technology_show', {'page' : numberOfPage}) }}" class="
                        {% if (numberOfPage == lastPageNumber) and (numberOfPage == page) %}
                        last
                        {% elseif (numberOfPage == 1) and (numberOfPage == page) %}first{% endif %}
                        {% if numberOfPage == page %}
                         active{% endif%}">{{ numberOfPage }}</a>
                        
                    {% endfor %}
                </div>
                {% if page < lastPageNumber %}
                    <a href="{{ path('technology_show', {'page' : page + 1}) }}">Next »</a>
                    <a href="{{ path('technology_show', {'page' : lastPageNumber}) }}" class="last">Last</a>
                {% endif %}
            </div>
        </div>
        {% endif %}

    </div>
    <!-- END #content -->

    {% include 'KatebaTTICOBundle:TTICO:side_bar.html.twig' %}

</div>
<!-- END .wrapper -->
{% endblock %}